package com.distribute.framework.dao;

import java.util.List;
import java.util.Map;

import com.distribute.framework.core.util.Function;
import com.distribute.framework.core.web.util.Page;
import com.distribute.framework.model.SrvProject;

/**
 * 项目菜单的Dao接口
 * @author 飞啊飘啊
 */
@SuppressWarnings("unchecked")
public interface ISrvProjectDao
{
	/**
	 * 获取所有项目菜单
	 * @return
	 */
	public List<SrvProject> getSrvProjectList(Map params,Integer offset,Integer size);

	/**
	 * 获取项目菜单统计
	 * @return
	 */
	public List getSrvProjectStats(Map params,Map<String,Object> groups,Map<String,Object> sums);

	/**
	 * 获取项目菜单总数
	 * @return
	 */	
	public Long getSrvProjectCount(Map params);
	
	/**
	 * 获取项目菜单自定义求和表达式,比如求和:eval="sum(id)"
	 * @return
	 */	
	public <T> T getSrvProjectEval(String eval,Map params);
	
	/**
	 * 获取项目菜单分页
	 * @return
	 */	
	public Page getSrvProjectPage(int page,int size,Map params);
	
	/**
	 * 根据查询条件取项目菜单
	 * @param params
	 * @return
	 */
	public SrvProject getSrvProject(Map params);	

	/**
	 * 根据ID取项目菜单
	 * @param id
	 * @return
	 */
	public SrvProject getSrvProjectById(Long id);


	
	

	/**
	 * 保存项目菜单
	 * @param srvProject
	 */
	public SrvProject saveSrvProject(SrvProject srvProject);

	/**
	 * 更新项目菜单
	 * @param srvProject
	 */
	public int updateSrvProject(SrvProject srvProject);
	/**
	 * 更新项目菜单非空字段
	 * @param srvProject
	 */
	public int updateSrvProject$NotNull(SrvProject srvProject);

	/**
	 * 根据ID删除一个项目菜单
	 * @param id
	 */
	public void deleteSrvProjectById(Long id);
	/**
	 * 根据条件更新项目菜单
	 * @param values
	 * @param params
	 */
	public int updateSrvProjectByConfirm(Map values, Map params);
	/**
	 * 根据条件删除项目菜单
	 * @param params
	 */
	public void deleteSrvProjectByConfirm(Map params);
	
	/**
	 * 执行过程，以便事务回滚
	 * @param function
	 */
	public <T> T executeTransaction(Function function);

}